<template>
  <div>
    <img
      class="formImg"
      mode="aspectFill"
      :src="formData.img"
      :alt="formData.img"
      @click="payClick"
    />
  </div>
</template>

<script>
import { getCurrentPageParams } from '@/utils'
// import { domain } from '@/utils/request'
import {} from '@/api'

export default {
  components: {},
  props: {},
  data () {
    return {
      formData: {}
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  onShow () {
    this.init()
  },
  methods: {
    payClick () {
      const vm = this
      vm
        .$dialog('是否确认开店并支付', '')
        .then(() => {
          vm.$router.push(
            `/pages/open-shop/open-shop-pay/main?amount=${
              vm.formData.amount
            }&openShopOrderNo=${vm.formData.openShopOrderNo}&customerId=${
              vm.formData.customerId
            }&shopIdentity=${vm.formData.shopIdentity}`
          )
        })
        .catch(() => {})
    },
    init () {
      const vm = this
      vm.formData = {
        img: getCurrentPageParams('img'),
        amount: getCurrentPageParams('amount'),
        openShopOrderNo: getCurrentPageParams('openShopOrderNo'),
        customerId: getCurrentPageParams('customerId'),
        shopIdentity: getCurrentPageParams('shopIdentity')
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.formImg {
  width: 100%;
  height: 100%;
}
</style>